﻿
/* ==============================================================================
*
*   Copyright (c) 2010, Pierre Favier
*   All rights reserved.
*
*   NTasking is free software: you can redistribute it and/or modify it
*   under the terms of the GNU General Public License as published by the
*   Free Software Foundation.
*
*   Redistribution and use in source and binary forms, with or without
*   modification, are permitted provided that the following conditions
*   are met:
*
*   -   Redistributions of source code must retain the above copyright notice,
*       this list of conditions and the following disclaimer.
*
*   -   Redistributions in binary form must reproduce the above
*       copyright notice, this list of conditions and the following
*       disclaimer in the documentation and/or other materials
*       provided with the distribution.
*
*   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
*   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
*   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
*   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
*   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
*   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
*   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
*   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*   SUCH DAMAGE.
*
* ============================================================================== */

// This code has been generated by the T4 engine. DO NOT EDIT otherwise your changes
// will be overwritten at next generation

using System;

namespace NTasking
{

    public abstract partial class Protected
    {
    
        // ReSharper disable InconsistentNaming
        
        #region For entry/proc/func with 0 parameters

        /// <summary>
        /// Declare an entry with no return type.
        /// </summary>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry(Action entry, Func<bool> When, Action Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry with a specific return type.
        /// </summary>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<RetT>(Func<RetT> entry, Func<bool> When, Func<RetT> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT>(ActionFamily<IndexT> entry, Func<IndexT, bool> When, Action<IndexT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT>(ActionFamily<IndexT> entry, Func<bool> When, Action<IndexT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, RetT>(FuncFamily<IndexT, RetT> entry, Func<IndexT, bool> When, Func<IndexT, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, RetT>(FuncFamily<IndexT, RetT> entry, Func<bool> When, Func<IndexT, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <param name="proc">The entry family.</param>
        /// <param name="Is">The entry's body.</param>
        protected void ReadWriteOperation(Action proc, Action Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="proc">The read-write method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadWriteOperation<RetT>(Func<RetT> proc, Func<RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-only protected method.
        /// </summary>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="func">The read-only method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadOnlyOperation<RetT>(Func<RetT> func, Func<RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(func, true, Is);
        }

        #endregion


        #region For entry/proc/func with 1 parameters

        /// <summary>
        /// Declare an entry with no return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T>(Action<P1T> entry, Func<bool> When, Action<P1T> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry with a specific return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, RetT>(Func<P1T, RetT> entry, Func<bool> When, Func<P1T, RetT> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T>(ActionFamily<IndexT, P1T> entry, Func<IndexT, bool> When, Action<IndexT, P1T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T>(ActionFamily<IndexT, P1T> entry, Func<bool> When, Action<IndexT, P1T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, RetT>(FuncFamily<IndexT, P1T, RetT> entry, Func<IndexT, bool> When, Func<IndexT, P1T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, RetT>(FuncFamily<IndexT, P1T, RetT> entry, Func<bool> When, Func<IndexT, P1T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="proc">The entry family.</param>
        /// <param name="Is">The entry's body.</param>
        protected void ReadWriteOperation<P1T>(Action<P1T> proc, Action<P1T> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="proc">The read-write method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadWriteOperation<P1T, RetT>(Func<P1T, RetT> proc, Func<P1T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-only protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="func">The read-only method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadOnlyOperation<P1T, RetT>(Func<P1T, RetT> func, Func<P1T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(func, true, Is);
        }

        #endregion


        #region For entry/proc/func with 2 parameters

        /// <summary>
        /// Declare an entry with no return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T>(Action<P1T, P2T> entry, Func<bool> When, Action<P1T, P2T> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry with a specific return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T, RetT>(Func<P1T, P2T, RetT> entry, Func<bool> When, Func<P1T, P2T, RetT> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T>(ActionFamily<IndexT, P1T, P2T> entry, Func<IndexT, bool> When, Action<IndexT, P1T, P2T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T>(ActionFamily<IndexT, P1T, P2T> entry, Func<bool> When, Action<IndexT, P1T, P2T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, RetT>(FuncFamily<IndexT, P1T, P2T, RetT> entry, Func<IndexT, bool> When, Func<IndexT, P1T, P2T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, RetT>(FuncFamily<IndexT, P1T, P2T, RetT> entry, Func<bool> When, Func<IndexT, P1T, P2T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="proc">The entry family.</param>
        /// <param name="Is">The entry's body.</param>
        protected void ReadWriteOperation<P1T, P2T>(Action<P1T, P2T> proc, Action<P1T, P2T> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="proc">The read-write method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadWriteOperation<P1T, P2T, RetT>(Func<P1T, P2T, RetT> proc, Func<P1T, P2T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-only protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="func">The read-only method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadOnlyOperation<P1T, P2T, RetT>(Func<P1T, P2T, RetT> func, Func<P1T, P2T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(func, true, Is);
        }

        #endregion


        #region For entry/proc/func with 3 parameters

        /// <summary>
        /// Declare an entry with no return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T, P3T>(Action<P1T, P2T, P3T> entry, Func<bool> When, Action<P1T, P2T, P3T> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry with a specific return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T, P3T, RetT>(Func<P1T, P2T, P3T, RetT> entry, Func<bool> When, Func<P1T, P2T, P3T, RetT> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T>(ActionFamily<IndexT, P1T, P2T, P3T> entry, Func<IndexT, bool> When, Action<IndexT, P1T, P2T, P3T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T>(ActionFamily<IndexT, P1T, P2T, P3T> entry, Func<bool> When, Action<IndexT, P1T, P2T, P3T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, RetT>(FuncFamily<IndexT, P1T, P2T, P3T, RetT> entry, Func<IndexT, bool> When, Func<IndexT, P1T, P2T, P3T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, RetT>(FuncFamily<IndexT, P1T, P2T, P3T, RetT> entry, Func<bool> When, Func<IndexT, P1T, P2T, P3T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="proc">The entry family.</param>
        /// <param name="Is">The entry's body.</param>
        protected void ReadWriteOperation<P1T, P2T, P3T>(Action<P1T, P2T, P3T> proc, Action<P1T, P2T, P3T> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="proc">The read-write method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadWriteOperation<P1T, P2T, P3T, RetT>(Func<P1T, P2T, P3T, RetT> proc, Func<P1T, P2T, P3T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-only protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="func">The read-only method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadOnlyOperation<P1T, P2T, P3T, RetT>(Func<P1T, P2T, P3T, RetT> func, Func<P1T, P2T, P3T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(func, true, Is);
        }

        #endregion


        #region For entry/proc/func with 4 parameters

        /// <summary>
        /// Declare an entry with no return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T, P3T, P4T>(Action<P1T, P2T, P3T, P4T> entry, Func<bool> When, Action<P1T, P2T, P3T, P4T> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry with a specific return type.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<P1T, P2T, P3T, P4T, RetT>(Func<P1T, P2T, P3T, P4T, RetT> entry, Func<bool> When, Func<P1T, P2T, P3T, P4T, RetT> Is)
        {
            CheckIsInBody();
            ProtectedEntry(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, P4T>(ActionFamily<IndexT, P1T, P2T, P3T, P4T> entry, Func<IndexT, bool> When, Action<IndexT, P1T, P2T, P3T, P4T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with no return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, P4T>(ActionFamily<IndexT, P1T, P2T, P3T, P4T> entry, Func<bool> When, Action<IndexT, P1T, P2T, P3T, P4T> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, P4T, RetT>(FuncFamily<IndexT, P1T, P2T, P3T, P4T, RetT> entry, Func<IndexT, bool> When, Func<IndexT, P1T, P2T, P3T, P4T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare an entry family with a specific return type.
        /// </summary>
        /// <typeparam name="IndexT">The type of the family's index.</typeparam>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="entry">The entry family.</param>
        /// <param name="When">The entry's barrier.</param>
        /// <param name="Is">The entry's body.</param>
        protected void Entry<IndexT, P1T, P2T, P3T, P4T, RetT>(FuncFamily<IndexT, P1T, P2T, P3T, P4T, RetT> entry, Func<bool> When, Func<IndexT, P1T, P2T, P3T, P4T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedFamily(entry, When, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="proc">The entry family.</param>
        /// <param name="Is">The entry's body.</param>
        protected void ReadWriteOperation<P1T, P2T, P3T, P4T>(Action<P1T, P2T, P3T, P4T> proc, Action<P1T, P2T, P3T, P4T> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-write protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="proc">The read-write method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadWriteOperation<P1T, P2T, P3T, P4T, RetT>(Func<P1T, P2T, P3T, P4T, RetT> proc, Func<P1T, P2T, P3T, P4T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(proc, false, Is);
        }


        /// <summary>
        /// Declare a read-only protected method.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the method's result.</typeparam>
        /// <param name="func">The read-only method.</param>
        /// <param name="Is">The method's body.</param>
        protected void ReadOnlyOperation<P1T, P2T, P3T, P4T, RetT>(Func<P1T, P2T, P3T, P4T, RetT> func, Func<P1T, P2T, P3T, P4T, RetT> Is)
        {
            CheckIsInBody();

            ProtectedMethod(func, true, Is);
        }

        #endregion

        // ReSharper restore InconsistentNaming

    }

}
